package com.gakj.truck.third.api.service;

import com.alibaba.fastjson.JSONObject;
import com.gakj.truck.third.api.mapper.TruckDtoMapper;
import com.gakj.truck.third.core.domain.TruckDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by gc on 2016/5/10.
 */
@Service
public class TruckDtoService {

    @Autowired
    TruckDtoMapper truckDtoMapper;

    @Autowired
    TruckImgDtoService truckImgDtoService;


    public JSONObject getAll(int day){
        JSONObject result = new JSONObject();
        List<TruckDto> all = truckDtoMapper.getAll(day);
//        for(TruckDto truckDto : all){
//            List<Map<String, String>> echoList = truckImgDtoService.getEchoList(truckDto.getId());
//            truckDto.setImgEchoList(echoList);
//        }

        result.put("data",all);
        result.put("resCode","1");
        result.put("resMsg","请求成功!");
        result.put("total",all.size());
        return result;
    }

}
